package zms.roya.http;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.net.UnknownHostException;

public class Gethttp1 {
	public static void main(String[] args) {
	 try {
		Socket s=new Socket("127.0.0.1",8113);
		BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
		bw.write("GET /Royasoft/index.jsp  HTTP/1.1");
		bw.newLine();
		bw.write("host: 127.0.0.1:8113");
		bw.newLine();
		bw.write("Content-Type:text/html");
		bw.newLine();
		bw.newLine();
		bw.flush();
		BufferedReader br=new BufferedReader(new InputStreamReader(s.getInputStream()));
		String str;
		while ((str=br.readLine())!=null)
		{
			System.out.println(str);
		}
		bw.close();
		br.close();
		s.close();
	} catch (UnknownHostException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	 

	}

}
